#pragma once

#include "qapplication.h"
#include "qsettings.h"

#include "spdlog/spdlog.h"
#include "spdlog/sinks/daily_file_sink.h"
#include "spdlog/fmt/ostr.h"
extern std::shared_ptr<spdlog::logger> logger;


#include "opencv/build/include/opencv2/opencv.hpp"
using namespace cv;
//#include "halcon_opencv.h"
typedef void(*CameraCallback)(Mat mat_iamge, void* pcontext);

class HkCamera
{
public:
    CameraCallback m_CallBack ;
    void* m_Context;
    void* m_camera_handle = nullptr;
    char* m_name = (char*)"";
    bool camera_init(char* name, CameraCallback pfunction, void* pcontext);

    bool startGrabbing();

    bool stopGrabbing();

    bool camera_end();

    bool setExposureTime(double value);

    bool setGainValue(double value);

    bool getExposureTime(double& value);

    bool getGainValue(double& value);

    bool setTriggerMode(int index);

    bool setTriggerSource();

    bool softwareTrigger();

    bool setFrameCount(unsigned int value);

    bool setOutput(bool value);
};

